package com.self.match.disruptor;

import lombok.Data;

import java.io.Serializable;

/**
 * @version v1.0
 * @ClassName: OrderEvent
 * @Description:
 * @Author: Mac
 * @Date: 2022/8/28 18:01
 */
@Data
public class OrderEvent implements Serializable {

    private static final long serialVersionUID = -469995175688940658L;
    /**
     * 时间戳
     */
    private final long timestamp;

    /**
     * 事件携带的数据
     */
    protected transient Object source;

    public OrderEvent(Object source) {
        this.source = source;
        this.timestamp = System.currentTimeMillis();
    }

    public OrderEvent() {
        this.timestamp = System.currentTimeMillis();
    }
}
